import {findInArray, getHistory, getState, setState, setStateReducer} from "../util/uitls";
import {effects} from 'dva/saga'

const INIT_STATE = {
    imageList: [1, 2, 3, 4, 5, 6],
    scrollTop: 0,
}
const Map = require('lodash.map')
const namespace = 'InfiniteScroll'
const MODEL = {
    namespace,
    state: INIT_STATE,
    reducers: {
        setState: setStateReducer
    },
    effects: {
        * setImageList({payload: {imageList, scrollTop}}, {call, put}) {
            yield setState({
                imageList,
                scrollTop
            })(namespace)
        },

    },
    subscriptions: {
        setup({dispatch, history}) {
        },
    },
};

export default MODEL
